<?php
/**
 * 修改签收记录为同意
 * User: Administrator
 * Date: 2018/8/7/007
 * Time: 21:46
 */

namespace app\lib\Order\OrderSign;


use app\model\OrderSignRecordModel;

class EditOrderSignRecord
{
    protected $signId;
    protected $opUid;
    protected $type;
    public function __construct($signId,$opUid)
    {
        $this->signId = $signId;
        $this->opUid = $opUid;
    }
    public function setType($type){
        $this->type = $type;
        return $this;
    }
    public function save(){
        $model =  new OrderSignRecordModel();
        $data[$model->_signId] = $this->opUid;
        $data[$model->_signType] = $this->type;
        $data[$model->_signTime] = time();
        $data[$model->_id]       = $this->signId;
        $result =  $model->update($data);
        if(!$result){
            exception('签收失败');
        }
        return true;
    }
}